package org.gfix.converter;

import static org.junit.Assert.*;

import java.math.BigDecimal;

import org.junit.Test;

public class BigDecimalConverterTest
{

	private static final String LARGE_FLOAT_NUMBER = "123456.658952446";

	@Test
	public void testConvertFromFix()
	{
		BigDecimalConverter converter = new BigDecimalConverter();
		BigDecimal bd = converter.convertFromFix(LARGE_FLOAT_NUMBER);
		assertNotNull(bd);
		assertEquals(new BigDecimal(LARGE_FLOAT_NUMBER),bd);
	}

	@Test
	public void testConvertToFix()
	{
		BigDecimalConverter converter = new BigDecimalConverter();
		BigDecimal bd =new BigDecimal(LARGE_FLOAT_NUMBER); 
		String s =	converter.convertToFix(bd);
		assertNotNull(s);
		assertEquals(LARGE_FLOAT_NUMBER,s);
	}

}
